package cn.edu.scau.cmi.zhuangjunsheng.comprehensiveExperiment;

import cn.edu.scau.cmi.zhuangjunsheng.domain.Meat;
import cn.edu.scau.cmi.zhuangjunsheng.simpleFactoryMethod.MeatFactory;
import cn.edu.scau.cmi.zhuangjunsheng.singleton.Marshal;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;

public class SimpleFactoryUI {
	
	@FXML
	private TextField tf;
	
	@FXML
	private TextArea ta;
	
	@FXML
	public void onTF(ActionEvent av) throws Exception {
		String meatName = tf.getText();
		Meat meat = MeatFactory.getInstance(meatName);
		ta.clear();
		ta.appendText(meat.cook1());
	}
}
